from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep

qq = webdriver.Chrome()

qq.implicitly_wait(1)

qq.get('https://im.qq.com/index')

qq.find_element(By.NAME, 'im.qq.com.login').click()

qq.switch_to.frame(0)
qq.find_element(By.ID, 'switcher_plogin').click()
username = qq.find_element(By.ID, 'u')
password = qq.find_element(By.ID, 'p')
username.send_keys('1157924912')
password.send_keys('**********\n')

sleep(10)
qq.quit()
